import React from 'react'
import {useNavigate,useLocation } from 'react-router-dom'
import {TabBar} from 'antd-mobile'
function Index() {
    const naviagte=useNavigate()
    const pathname=useLocation().pathname
  return (
    <div>
        <div style={{position:'fixed',bottom:'0', width:'100vw'}}>
            <TabBar activeKey={pathname} onChange={(key)=>naviagte(key)}>
                <TabBar.Item key={'/'} title="首页"></TabBar.Item>
                <TabBar.Item key={'/xiaoxi'} title="消息"></TabBar.Item>
                <TabBar.Item key={'/my'} title="我的"></TabBar.Item>

            </TabBar>

        </div>
    </div>
  )
}

export default Index
